#include <iostream>

#include "edaTS.h"
#include "edaSimpleMoveTabuList.h"
#include "edaNoAspirCrit.h"
#include "edaImprBestFitAspirCrit.h"
#include "edaGenContinue.h"
#include "loNetList.hpp"
#include "loScriptMove.hpp"
#include "loScriptMoveNext.hpp"
#include "sisInterface.h"

int main(int argc, char **argv)
{
  if (argc != 2) {
    std::cerr << "Usage : ./loTBSearch [instance]" << std::endl;
    return 1;
  }

  srand(time(NULL));

  // start SIS
  sisInit();

  loNetList netlist( argv[1] );


  loScriptMove script;
  loScriptMoveNext scriptNext( 0, 5 );
  edaSimpleMoveTabuList tabuList;
//  edaNoAspirCrit aspirCrit;
  edaImprBestFitAspirCrit aspirCrit;
  edaGenContinue cont_criteria(1000);

  script.setScriptDir( "scripts" );

  edaTS tsSearch( &script, &scriptNext, &tabuList, &aspirCrit, &cont_criteria);

  std::cout << "[From Fitness] " << netlist.fullEvaluate() << std::endl;
  tsSearch.search( netlist );
  std::cout << "[To Fitness] " << netlist.fullEvaluate() << std::endl;

  // end SIS
  sisEnd();

  return 0;
}
